home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr40 / x1j4pk96.zip / DEVMETER.TXT < prev    next >
Text File  |  1995-01-28  |  14KB  |  344 lines

  1. Deviation Meter Details                               Page 1
  2.  
  3.              Deviation Meter For TheNet X-1J
  4.  
  5. 1. INTRODUCTION
  6.  
  7.      The  deviation meter is actually a peak audio  level
  8.      meter.  It  is the first of a series of applications
  9.      built  into TheNet X-series firmware that makes  use
  10.      of an Analogue to Digital Converter ( ADC ). The ADC
  11.      can be (optionally) added quite simply to a TNC2.
  12.      
  13.      This paper describes the circuit, its configuration
  14.      and its operation, but there is a separate set of
  15.      files that describes the deviation meter in more
  16.      detail, containing the artwork, netlist etc. If you
  17.      can't find the archive of this set of files (
  18.      originally named X1JDEV.ZIP ), contact G0JVU.
  19.      
  20. 2. CIRCUIT OVERVIEW
  21.      
  22.      The basic structure of the circuit is shown below :
  23.      
  24.      
  25.      << circuit is in windows file version >>
  26.      
  27.      
  28.      The  audio input is amplified and converted to a  DC
  29.      peak  representation. This voltage is  read  by  the
  30.      ADC,  which  has  a  range of  0  ..  3  volts,  and
  31.      converted into an 8 bit binary value in the range  0
  32.      .. 255.
  33.      
  34.      The  software is configured to read the ADC  at  the
  35.      end  of  each  valid packet. A packet is  considered
  36.      valid if its CRC is correct. As soon as a valid  CRC
  37.      is   detected,  the  ADC  is  instructed  to   start
  38.      converting  on  the  deviation meter  channel,  this
  39.      conversion  taking 30 microseconds. Just before  the
  40.      formatted frame is linked into the chain of  pending
  41.      received  frames,  the ADC is  read  and  the  value
  42.      stored with the frame.
  43.      
  44.      The  reading therefore corresponds to the peak audio
  45.      level  at the end of a packet. If there are  no  non
  46.      linear elements between the receiver's discriminator
  47.      and  the  meter  input, this will correspond  fairly
  48.      accurately to the peak deviation.
  49.      
  50.      Care  must be taken over its interpretation. It does
  51.      not  measure independently the two tone levels -  it
  52.      is assumed that whatever local standards that relate
  53.      to  pre-emphasis ( i.e. use it or not  )  have  been
  54.      implemented.  If used for 9600 baud  FSK  operation,
  55.      this is not a problem.
  56.      
  57.      The   meter  will  give  the  wrong  answer  on  the
  58.      following conditions :
  59.      
  60.           A badly distorted audio signal
  61.           Badly off frequency
  62.           Incorrect  adherence  to  local  pre-emphasis
  63.           standards if used for AFSK
  64.           A noisy signal
  65.      
  66. 3. SOFTWARE
  67.      
  68.      As  explained in section 2, the deviation  meter  is
  69.      activated on receipt of a valid packet. The software
  70.      interrupt  routine,  upon  detecting  a  valid  CRC,
  71.      whether  the  deviation meter is installed  or  not,
  72.      whether  it is enabled or not, will instantly  write
  73.      the 'start channel conversion' command to the ADC  (
  74.      I/O  address  0x20  ) as soon as  the  interrupt  is
  75.      serviced.  It will therefore also be signalled  when
  76.      other  errors  such as framing or invalid  CRCs  are
  77.      detected.
  78.      
  79.      If  the  CRC  is  correct,  then  about  50  to  100
  80.      microseconds later, the Z80 will read  the  ADC  and
  81.      will  store the corresponding value with the packet.
  82.      Again,  this happens whether or not the function  is
  83.      enabled (it is quicker to do it than to test whether
  84.      to do it or not ! ).
  85.      
  86.      The  value  received is transferred to the  internal
  87.      heard  list format without conversion. It  is  still
  88.      therefore the 8 bit count ( 0 to 255 ).
  89.      
  90.      When  a  user displays the heard list, the deviation
  91.      meter parameter ( as set with the METER command ) is
  92.      used  to  control  the  display.  If  disabled,  the
  93.      deviation  details are not displayed  in  the  heard
  94.      list.  If it is enabled, then the 8 bit count  value
  95.      is  multiplied  by the multiplier value  to  give  a
  96.      deviation  reading in hertz. This  is  displayed  as
  97.      kilohertz  in  the  heard list.  If  the  multiplier
  98.      setting  is '1' it will have a full scale  range  of
  99.      0.2  KHz ( not very useful ). If set to 10, it  will
  100.      have  a full scale range of 2.5 KHz. If set to  255,
  101.      it will display up to 64 KHz. A typical setting will
  102.      therefore be in the range 15 to 30, depending on the
  103.      analogue  setting. The objective is to set  it  such
  104.      that  the  maximum  possible audio  level  from  the
  105.      receiver,  given  its filters, corresponds  to  just
  106.      under the 3 volt maximum input to the ADC.
  107.      
  108.      The  deviation is displayed to a resolution  of  100
  109.      Hz,  but  it  should  not  be  assumed  to  be  this
  110.      accurate.
  111.      
  112.      Small fluctuations in the reading can be expected.
  113.      
  114.      Finally,  to  guard against an unnoticed  overrange,
  115.      the  display  in  the heard list  will  precede  the
  116.      deviation reading by a chevron ( '>' ) if the  value
  117.      read from the ADC is 254 or 255.
  118.      
  119. 4. Detailed Circuit Description.
  120.  
  121.      All  of  the signals necessary for this circuit  are
  122.      found  on  the  Z80  CPU chip  located  on  the  TNC
  123.      motherboard,  with  the exception  of  a  -5V  power
  124.      supply, and the audio signal to be measured.
  125.      
  126.      We  therefore decided to base the circuit around the
  127.      Z80  CPU.  We knew from experience that  people  are
  128.      reluctant to attack the insides of their TNCs'  with
  129.      a hot soldering iron, and settled on the socket idea
  130.      as  the least intrusive way of gaining access to the
  131.      required signals.
  132.      
  133.      The circuit was designed with the radio ham junk box
  134.      in  mind,  with the only "specialist part"  required
  135.      being the ADC itself.
  136.      
  137.      The  input is first amplified (x10) by U2A a quarter
  138.      part  of the LM324 quad op-amp. This circuit is also
  139.      a  precision half-wave rectifier, which is  used  to
  140.      reduce  the  effect of D1's voltage offset.  A  more
  141.      linear response is obtained with this configuration.
  142.      The output is smoothed by C2, and then R3 provides a
  143.      user adjustable control for the DC representation of
  144.      the received audio level into the ADC.
  145.      
  146.      The second part of the quad op-amp (U2B) provides  a
  147.      low  impedance voltage reference drive for the  ADC.
  148.      R6  should be adjusted such that the DC level on pin
  149.      8 (VREF) on the ADC is equal to 3.0 V.
  150.      
  151.      The  address  decode for the ADC is performed  by  2
  152.      parts  of the 74HC00 (U3). The ADC is mapped to  the
  153.      I/O  address  0x20  and  is  selected  by  the  X-1J
  154.      software when required.
  155.  
  156.           The  other  three (customisable)  ADC  channels
  157.     will  be  available  for use in later  releases,  for
  158.     such  items as temperature sensors, pressure sensors,
  159.     or  whatever  comes to mind that will be of  interest
  160.     to  users  etc.  There  are also  two  spare  op-amps
  161.     within  the  LM324  for use with these  'customisable
  162.     inputs'.  Any  input signal should be conditioned  to
  163.     provide a 0V...3V full scale signal into the ADC .
  164.  
  165. 4.1 Parts List
  166.  
  167.  
  168.       QTY  REF     PART                     
  169.                                             
  170.       2    C1, C3  1 ╡F @ 10V               
  171.       1    C4      0.1 ╡F (de coupling      
  172.                    capacitor)
  173.       1    C2      22 ╡F @ 10V              
  174.       1    R1      10K                      
  175.       2    R5,R7   1K                       
  176.       1    R4      1K8                      
  177.       2    R3,R6   10K Miniature            
  178.                    Potentiometers
  179.       1    R2      100K                     
  180.       2    D1,D3   IN4148                   
  181.       1    D2      2V7 Zener (250mW)        
  182.       1    U1      ADC0844 (National        
  183.                    Semiconductor) *
  184.       1    U2      LM324                    
  185.       1    U3      74HC00                   
  186.       1    JP1     3 pin HEADER             
  187.       1    40PIN   40PIN WIRE WRAP SOCKET   
  188.       1            PCB                      
  189.       1    X-1J    SOFTWARE!                
  190.  
  191.     *  The  ADC0844 is a four channel ADC available  from
  192.     most  large mail-order companies. At the time of  the
  193.     X1J  release  (August '93), I have had  some  concern
  194.     over   the  price  of  the  device.  When  originally
  195.     selected the device was available for approx.  ú8  in
  196.     the  UK. In the last two months it has risen to  ú18!
  197.     It  may  be  cheaper direct from outlets  within  the
  198.     USA.
  199. 5. Construction
  200.  
  201.      PCB's, PCB patterns, and component locations will be
  202.      available  from G0JVU / G8KBB starting in September,
  203.      1993.  The  PCB will be single sided and  approx.  3
  204.      inches by 2 ╜ inches.
  205.      
  206.      However the circuit is not complex and for the  more
  207.      adventurous a small circuit can be built up (without
  208.      the  need for a 40 pin socket) and then wired to the
  209.      solder  side  of the TNC motherboard.  In  fact  the
  210.      original  prototype  built on veroboard  measured  1
  211.      inch by 2╜ inches.
  212.      
  213.      The 40 pin socket on the DEV PCB is intended to be a
  214.      wire  wrap type, soldered to the DEV unit  PCB  with
  215.      long  legs extending down, cropped so that  the  PCB
  216.      can  be "plugged" into the 40 pin Z80 socket on  the
  217.      TNC  motherboard. The previously removed Z80 CPU  is
  218.      then re-inserted in the socket on the DEV PCB.
  219.  
  220.  
  221.  
  222.  
  223.  
  224.      If your TNC's Z80 is not socketed, you may like to
  225.      consider adding one now! Otherwise you will need to
  226.      work out some other way of getting the necessary
  227.      signals to the DEV board. I suggest fitting a  "tin-
  228.      plate" folded pin socket, as the wire wrap sockets
  229.      will locate into them. Turned pin sockets present
  230.      extreme difficulty in mating with the square section
  231.      wire wrap sockets.
  232.      
  233.      If  there is not enough clearance in the TNC box for
  234.      the extra PCB, you could consider using a header
  235.      plug, with the necessary signals being transferred
  236.      to the DEV board , mounted elsewhere, via a short
  237.      cable.
  238.      
  239.      There are three other connections that need to be
  240.      made from the DEV PCB to the TNC motherboard:
  241.                             
  242.       JP1 Pin  Cable shield for audio
  243.          1     signal (Earth)
  244.       JP1 Pin  Audio input from rig (5pin
  245.          2     DIN inside TNC)
  246.       JP1 Pin  -5V (from TNC motherboard)
  247.          3
  248.                             
  249.  
  250.      Solder in the components in the usual way, taking
  251.      care not to make any solder bridges to the tracks
  252.      running in-between the IC pads. Ensure the chips,
  253.      and polarised components are the right way around,
  254.      and take the usual ESD precautions. There are four
  255.      wire links needed on the PCB to complete the single-
  256.      sided circuit.
  257.  
  258.  
  259. 6. Alignment
  260.  
  261.      There are four adjustable controls that will need to
  262.      be set-up for correct operation.
  263.      
  264.      1)   Radio's audio drive signal into the TNC.
  265.      (Volume control).
  266.      2)   The deviation signal level control (R3).
  267.      3)   The reference voltage for the ADC. (R6)
  268.      4)   The METER parameter within X-1J.
  269.      
  270.      The best set-up sequence (todate)  is:-
  271.      
  272.      a) Adjust R6 on the DEV board to give 3.0V input
  273.      into pin 8 of the ADC.
  274.      b) Attach an oscilloscope (if available) to pin 1 of
  275.      the LM324. Turn the rig's squelch control such that
  276.      the squelch noise is driving the input of the DEV
  277.      circuit. Adjust the rig's audio drive signal into
  278.      the DEV circuit so that the output of the op-amp is
  279.      just clipping the power rails. This will be seen as
  280.      a 10V peak to peak signal.
  281.      c) Adjust R3 to give the maximum DC signal into pin
  282.      3 of the ADC. This should be 3V maximum.
  283.      
  284.      Note: The function of R3 is to scale the input
  285.      voltage into the ADC. The maximum signal available
  286.      from the circuit is approx. 3V which corresponds to
  287.      the full range of the ADC. A 3V input into the ADC
  288.      will enable the circuit to present the widest
  289.      possible range of values to the X-1J software.
  290.      However significant "unexplained" variations in the
  291.      reported deviation (MHEARD list) can be reduced by
  292.      lowering the input voltage to the ADC. If you do
  293.      need to adjust this voltage, then you will also have
  294.      to adjust the METER parameter within the X-1J
  295.      software again.
  296.      
  297.      d) The "METER" parameter within X-1J gives the final
  298.      adjustment to the circuit. Converting the received
  299.      binary number into a meaningful deviation in KHz.
  300.      In practice with the unit operating as described
  301.      above, a value of 47 was found to provide a true
  302.      representation of the displayed deviation to the
  303.      measured deviation. To ensure an accurate
  304.      measurement is given to the user, you will need to
  305.      calibrate the function using a signal with a known
  306.      deviation!
  307.      
  308.      As you can see from the above set up procedure. If
  309.      you change the setting of the volume on the rig
  310.      afterwards, all will be lost!   It is preferable to
  311.      take the audio from before the audio amplifier
  312.      sections of the receiver ( ideally direct from the
  313.      discriminator ) and to adjust the parameters or op-
  314.      amp gain accordingly.
  315.  
  316. 7. Contacts.
  317.  
  318.      G8KBB can be contacted via...
  319.      
  320.      G8KBB @ GB7MXM
  321.      +44 473 682266 ( GMT 19:00 - 2200)
  322.      
  323.      Dave Roberts
  324.      7, Rowanhayes Close
  325.      Ipswich
  326.      IP2 9SX
  327.      ENGLAND
  328.      
  329.      G0JVU can be contacted via....
  330.      
  331.      G0JVU @ GB7MXM
  332.      G0JVU @ G0JVU.ampr.org
  333.      NEVILLE @ SWFMC1.SINET.SLB.COM
  334.      Compuserve: 100021,3307
  335.      +44 394 274795 (GMT 19:00 - 22:00)
  336.      
  337.      Neville Pattinson
  338.      10, High Hall Close
  339.      Trimley St Martin
  340.      Felixstowe
  341.      Suffolk
  342.      IP10 0TJ
  343.  
  344.